# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=amtk
pkgver=5.3.1
pkgrel=1
pkgdesc="Actions, Menus and Toolbars Kit for GTK+ applications"
url="https://wiki.gnome.org/Projects/Amtk"
arch=(x86_64)
license=(LGPL)
depends=(gtk3)
makedepends=(meson git gobject-introspection gtk-doc)
_commit=29f7889b67bdebbd8c3119f1d48d44fafa413c99  # tags/5.3.1^0
source=("git+https://gitlab.gnome.org/GNOME/amtk.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build -D gtk_doc=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(libg{lib,object,io}-2.0.so libgtk-3.so)
  provides+=("libamtk-${pkgver%%.*}.so")

  DESTDIR="$pkgdir" meson install -C build
}
